using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ERPBackend.Models;

namespace ERPBackend.Services
{
    public interface ISalesOrderService
    {
        /// <summary>
        /// 获取所有销售订单
        /// </summary>
        Task<List<SalesOrder>> GetAllSalesOrdersAsync();

        /// <summary>
        /// 根据ID获取销售订单
        /// </summary>
        Task<SalesOrder> GetSalesOrderByIdAsync(int id);

        /// <summary>
        /// 创建销售订单
        /// </summary>
        Task<SalesOrder> CreateSalesOrderAsync(SalesOrder salesOrder);

        /// <summary>
        /// 更新销售订单
        /// </summary>
        Task<bool> UpdateSalesOrderAsync(SalesOrder salesOrder);

        /// <summary>
        /// 审核销售订单
        /// </summary>
        Task<bool> ApproveSalesOrderAsync(int id, int approvedBy);

        /// <summary>
        /// 关闭销售订单
        /// </summary>
        Task<bool> CloseSalesOrderAsync(int id, int closedBy, string reason);

        /// <summary>
        /// 删除销售订单
        /// </summary>
        Task<bool> DeleteSalesOrderAsync(int id);

        /// <summary>
        /// 搜索销售订单
        /// </summary>
        Task<List<SalesOrder>> SearchSalesOrdersAsync(string keyword = null, int? customerId = null, int? status = null);
    }
}